#include<iostream>
#include<vector>
using namespace std;
#include"unorderedSet.h"
#include"unorderedMap.h"

void test_set()
{
	// 17:05
	myUnorderedSet::unordered_set<int> us;
	us.insert(5);
	us.insert(15);
	us.insert(52);
	us.insert(3);

	myUnorderedSet::unordered_set<int>::iterator it = us.begin();
	while (it != us.end())
	{
		//*it += 5;
		cout << *it << " ";
		++it;
	}
	cout << endl;

	for (auto e : us)
	{
		cout << e << " ";
	}
	cout << endl;
}

void test_map()
{
	myUnorderedMap::unordered_map<string, string> dict;
	dict.insert(make_pair("sort", ""));
	dict.insert(make_pair("string", "?"));
	dict.insert(make_pair("insert", ""));

	for (auto& kv : dict)
	{
		//kv.first += 'x';
		kv.second += 'x';

		cout << kv.first << ":" << kv.second << endl;
	}
	cout << endl;

	string arr[] = { "?", "","?", "", "?", "", "?", "?", "", "?", "?", "?", "?" };
	myUnorderedMap::unordered_map<string, int> count_map;
	for (auto& e : arr)
	{
		count_map[e]++;
	}

	for (auto& kv : count_map)
	{
		cout << kv.first << ":" << kv.second << endl;
	}
	cout << endl;
}

int main()
{
	//test_set();
	test_map();


	return 0;
}